package mysql

import "gorm.io/gorm"

type Typer struct {
	gorm.Model
	Name string `gorm:"type:varchar(30);分类名称"`
}

func (t *Typer) FindTyper(db *gorm.DB, name string) error {
	return db.Debug().Where("name=?", name).First(&t).Error
}

func (t *Typer) TyperAdd(db *gorm.DB) error {
	return db.Debug().Create(&t).Error
}
